package cn.hairui.blog.repository.manage;

import cn.hairui.blog.mapper.manage.ResourceMapper;
import cn.hairui.blog.model.manage.MgrResc;
import cn.hairui.blog.model.manage.MgrRescmenu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author lihairui
 * @version V1.0
 * @date: 2019/8/4 11:57
 */
@Repository
public class ResourceRepository {

    @Autowired
    private ResourceMapper resourceMapper;

    public List<MgrResc> listRescMgrShow() {
        return resourceMapper.listRescMgrShow();
    }

    public List<MgrRescmenu> findMgrRescmenuByrescId(String rescId) {
        return resourceMapper.findMgrRescmenuByrescId(rescId);
    }

    public List<Map> listMgrRescMgr() {
        return resourceMapper.listMgrRescMgr();
    }

    public void addMgrResc(MgrResc mgrResc) {
        resourceMapper.addMgrResc(mgrResc);
    }

    public MgrResc findMgrResc(String rescId) {
        return resourceMapper.findMgrResc(rescId);
    }

    public void updateMgrResc(MgrResc mgrResc) {
        resourceMapper.updateMgrResc(mgrResc);
    }

    public List<Map> listMgrRescmenuMgr() {
        return resourceMapper.listMgrRescmenuMgr();
    }

    public MgrRescmenu findMgrRescmenu(String rescId, String href) {
        return resourceMapper.findMgrRescmenu(rescId, href);
    }

    public void addMgrRescmenu(MgrRescmenu mgrRescmenu) {
        resourceMapper.addMgrRescmenu(mgrRescmenu);
    }

    public void updateMgrRescmenu(MgrRescmenu mgrRescmenu) {
        resourceMapper.updateMgrRescmenu(mgrRescmenu);
    }

    public void deleteMgrRescmenu(String rescId, String href) {
        resourceMapper.deleteMgrRescmenu(rescId, href);
    }

    public void deleteMgrResc(String rescId) {
        resourceMapper.deleteMgrResc(rescId);
    }
}
